import {
  createRouter,
  createWebHistory,
  RouteRecordRaw,
  createWebHashHistory,
} from "vue-router";
import { App } from "vue";
const routes: RouteRecordRaw[] = [

  //  模板start
  {
    path: "/",
    name: "index",
    component: () => import("../views/index.vue"),
  },
  {
    path: "/login2",
    name: "login2",
    component: () => import("../views/login/login2.vue"),
  },

  //  模板end
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login/login.vue"),
  },
  {
    path: "/register",
    name: "register",
    component: () => import("../views/login/register.vue"),
  },
  {
    path: "/homepage",
    name: "homepage",
    component: () => import("../views/homepage/homepage.vue"),
    children:[
      {
        path: "/customer",
        name: "customer",
        component: () => import("../views/homepage/customer/list.vue"),
      },
      {
        path: "/customer_edit",
        name: "customer_edit",
        component: () => import("../views/homepage/customer/edit.vue"),
      },
      {
        path: "/follow",
        name: "follow",
        component: () => import("../views/homepage/follow/list.vue"),
      },
      {
        path: "/follow/edit",
        name: "follow_edit",
        component: () => import("../views/homepage/follow/edit.vue"),
      },
      {
        path: "/booking",
        name: "booking",
        component: () => import("../views/homepage/booking/list.vue"),
      },
      {
        path: "/users",
        name: "users",
        component: () => import("../views/homepage/users/users.vue"),
      },
      {
        path: "/users_edit",
        name: "users_edit",
        component: () => import("../views/homepage/users/users_edit.vue"),
      },
      {
        path: "/bumen",
        name: "bumen",
        component: () => import("../views/homepage/users/bumenManagement.vue"),
      },
      {
        path: "/role",
        name: "role",
        component: () => import("../views/homepage/users/roleManagement.vue"),
      },
      {
        path: "/menu",
        name: "menu",
        component: () => import("../views/homepage/users/menuManagement.vue"),
      },
      {
        path: "/webStation",
        name: "webStation",
        component: () => import("../views/homepage/webStation/webStation.vue"),
      },
    ]
    // children: [
    //   {
    //     path: "/users",
    //     name: "users",
    //     component: () => import("../views/homepage/users/userManagement.vue"),
    //   },
    //   {
    //     path: "/bumen",
    //     name: "bumen",
    //     component: () => import("../views/homepage/users/bumenManagement.vue"),
    //   },
    //   {
    //     path: "/role",
    //     name: "role",
    //     component: () => import("../views/homepage/users/roleManagement.vue"),
    //   },
    //   {
    //     path: "/menu",
    //     name: "menu",
    //     component: () => import("../views/homepage/users/menuManagement.vue"),
    //   },
    //   {
    //     path: "/booking",
    //     name: "booking",
    //     component: () => import("../views/homepage/booking/list.vue"),
    //   },
    //   {
    //     path: "/customer",
    //     name: "customer",
    //     component: () => import("../views/homepage/customer/list.vue"),
    //     children:[
    //       {
    //         path: "/customer/add",
    //         name: "customer_add",
    //         component: () => import("../views/homepage/customer/add.vue"),
    //       },
    //     ],
    //   },
    //
    // ],
  },
];
const router = createRouter({
  history: createWebHistory(),
  routes,
});
export const initRouter = (app: App<Element>) => {
  app.use(router);
};
// export default router
